<%-- 
    Document   : useredit
    Created on : 2012-3-16, 17:56:24
    Author     : xiaoxiao
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib  prefix="s"  uri="/struts-tags"%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>用户编辑</title>
        <link href="css/global.css" rel="stylesheet" type="text/css">
        <link href="css/form.css" rel="stylesheet" type="text/css">
        <style type="text/css">
            div.header
            {
                font-family: 微软雅黑;
                padding:18px;
                color:white;
                background-color:#7B994F;
                text-align: center;
                height: 60px;
                width: 220px;
                margin-left: 420px;
                margin-top: 50px;
            }
        </style>
        <script type="text/javascript" src="js/jquery.min.js"></script>
        <script type="text/javascript" src="js/jquery.validate.js"></script>
        <script type="text/javascript">
            $(document).ready(function() {
                $('#signup').validate({
                    rules: {
                        username: {
                            required: true,
                            rangelength:[4,16]
                        },
                        email: {
                            required: true,
                            email: true
                        },
                        password: {
                            required: true,
                            rangelength:[5,16]
                        }

                    }, //end rules
                    messages: {
                        username: {
                            required: '请输入用户名',
                            rangelength: '用户名在 4 到 16 位之间'
                        },
                        email: {
                            required: "请输入邮箱地址",
                            email: "不是有效的邮箱地址"
                        },
                        password: {
                            required: '请输入密码',
                            rangelength: '密码在 5 到 16 位之间'
                        }
                    }
                }); // end validate
            }); // end ready()
        </script>
    </head>
    <body>
        <s:if test="%{#session.qx}">
            <div id="contentWrap">
                <div id="main">
                    <h2>编辑用户</h2>
                    <s:form action="useredit" method="post"  name="signup" id="signup">
                        <s:hidden name="userid" value="%{user.userid}"></s:hidden>
                        <div>
                            <label  class="label">用户名</label>
                            <s:textfield name="username"  value="%{user.username}"></s:textfield>
                        </div>
                        <div>
                            <label  class="label">密码</label>
                            <s:textfield name="password"  value="%{user.password}"></s:textfield>
                        </div>
                        <div>
                            <label  class="label">邮箱</label>
                            <s:textfield name="email" label="邮箱" value="%{user.email}"></s:textfield>
                        </div>
                        <div>
                            <s:submit value="修改" id="ereset"></s:submit>
                            <input type="button" id="submit" onclick="history.back()" value="返回" >
                        </div>
                    </s:form>
                </div>
            </div>
        </s:if>
        <s:else>
            <div class="header">
                您没有管理员权限！
                <br>请以管理员身份登陆管理
            </div>
        </s:else>
    </body>
</html>
